package service;

import dao.BookMapper;
import dao.UserMapper;
import pojo.Books;
import pojo.Users;

import java.util.List;

public class UserServiceImpl implements UserService {
    private UserMapper userMapper;
    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    public int addUser(Users user) {
        return userMapper.addUser(user);
    }

    public int deleteUserById(int id) {
        return userMapper.deleteUserById(id);
    }

    public Users queryUserById(int id) {
        return userMapper.queryUserById(id);
    }

    public int updateUser(Users users) {
        return userMapper.updateUser(users);
    }

    public List<Users> queryAllUser() {
        return userMapper.queryAllUser();
    }

    public List<Users> queryUser(String username) {
        return userMapper.queryUser(username);
    }

//    调用dao层的操作，设置一个set接口，方便Spring管理

}
